package my.utils;

import java.util.UUID;

public final class VerifyUtil {
	public static String getVerifyCode(int id) {
		UUID uuid = UUID.randomUUID();
		return uuid.toString() + "-" + id;
	}

	public static String getUUID(String code) {
		int index = code.lastIndexOf("-");
		return code.substring(0, index);
	}

	public static String getUserID(String code) {
		int index = code.lastIndexOf("-");
		return code.substring(index + 1);
	}

	public static void main(String[] args) {
		System.out.println(getVerifyCode(3));
		System.out.println(getVerifyCode(4));
	}
}
